//
//  UITextView+LineSpace.m
//  WelfareManager
//
//  Created by timtian on 17/2/21.
//  Copyright © 2017年 timtian. All rights reserved.
//

#import "UITextView+LineSpace.h"

@implementation UITextView (LineSpace)
// 调整行间距
-(NSAttributedString *)getAttributedStringWithString:(NSString *)string lineSpace:(CGFloat)lineSpace {
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    paragraphStyle.lineSpacing = lineSpace; // 调整行间距
    NSRange range = NSMakeRange(0, [string length]);
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range];
    return attributedString;
}
@end
